New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encapsulate IA2 relations constants #13096
Conversation
Compat breaking refactor: - Removed IA2_RELATION_FLOWS_FROM - Removed IA2_RELATION_FLOWS_TO - Removed IA2_RELATION_CONTAINING_DOCUMENT - Replaced with IAccessibleHandler.RelationType enum
We currently define all the IA2 relation constants in NVDA ourself, as although they are defined in IAccessible2's accessibleRelation.idl, they are all separate constants, not referenced directly or indirectly by the IAccessible2 Library definition, thus never included in the type library, and therefore never exposed to NVDA via comtypes. |
Thanks @michaelDCurran that is helpful to know. I guess we'll progress with this PR as it is, and consider getting that IDL changed? |
This breaks in Thunderbid:
|
@LeonarddeR a fix is in progress (see PR #13112). If possible, please test the PR build, thanks! |
- The RelationType enum now also inherits from str, its values can now be used as a string value. - Fixed conversion of plain str types to RelationType - Use faster approach to get relations of type (using dedicated method in IAccessible_2_2) Fixes #13109 - Thunderbird and Firefox were broken with PR #13096.
Link to issue number:
None
Summary of the issue:
IAccessible2 code that depends on fetching objects related to other objects uses these constants.
Since these values are strings, and not defined in an IDL file, we should encapsulate them in an
Enum.
Description of how this pull request fixes the issue:
Encapsulate the constants in a Relations enum under IAccessibleHandler.
This is a compatibility breaking change, however it's not expected that many Addons use this code.
All internal usages of the constants have been updated:
git grep -i IA2_RELATION_
Testing strategy:
Known issues with pull request:
Compatibility breaking change.
Change log entries:
For Developers
- IAccessibleHandler IA2_RELATION_* constants have been replaced with the IAccessibleHandler.RelationType enum.
Code Review Checklist: